package com.mgy.im.autoconfigure;

import lombok.*;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * xxx
 *
 * @author maguoyong
 * @date 2020/6/14
 */
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Getter
@Setter
@ConfigurationProperties(prefix = "netty.websocket")
public class NettyWebSocketProperties {

    /**
     * /ws
     */
    private String path = "/ws";


    private String host;

    private Integer port = 0;

    @Builder.Default
    private Integer bossLoopGroupThreads = 0;
    @Builder.Default
    private Integer workerLoopGroupThreads = 0;
    @Builder.Default
    private boolean isUseCompressionHandler = false;
    @Builder.Default
    private Integer connectTimeoutMillis = 30000;
    @Builder.Default
    private Integer soBacklog = 128;
    @Builder.Default
    private Integer writeSpinCount = 16;
    @Builder.Default
    private Integer writeBufferHighWaterMark = 65536;
    @Builder.Default
    private Integer writeBufferLowWaterMark = 32768;
    @Builder.Default
    private Integer soRcvbuf = -1;
    @Builder.Default
    private Integer soSndbuf = -1;

    private boolean isTcpNodelay;

    private boolean isSoKeepalive;
    @Builder.Default
    private Integer soLinger = -1;

    private boolean isAllowHalfClosure;
    @Builder.Default
    private Integer readerIdleTimeSeconds = 0;
    @Builder.Default
    private Integer writerIdleTimeSeconds = 0;
    @Builder.Default
    private Integer allIdleTimeSeconds = 0;
    @Builder.Default
    private Integer maxFramePayloadLength = 65536;
}
